home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
mail
/
mailleds.93
/
mailleds
/
mailleds-0.93
/
README
< prev
next >
Wrap
Text File
|
1996-04-10
|
7KB
|
168 lines
----------------------
mailleds ver 0.92-beta
----------------------
NOTES on 0.92-beta:
If you're a root user (like I am), and have a nifty bank of parallel port
leds (like I do), you may be interested the -u option, which will allow you
to start mailleds from /etc/rc.local or such. the lines of my
/etc/rc.d/rc.local read:
/usr/local/bin/mailleds -lp7 -u mtr -a
/usr/local/bin/mailleds -lp6 -u carolyn -a
NOTES on 0.9-beta:
One no longer has to specify terminals with the -t option. Simply add -t
(or don't, since -t is default) to the command line, and mailleds will use
utmp to figure out the neccesary vt's.
Having said this,
"mailleds -t -l s" will now do nicely. This is the same as "mailleds -l s" and
(probably, depending on compile-time options) "mailleds"
If anyone actually cared about having a "status" vt, (ie tty7 might be used
to check if you have mail) mail me and I'll probably put the option to
specify ttys on the command line back in.
X support. Well, what can I say. I screwed around with having the "regular"
mailleds process latch on and detach from an X server. That was far too painful.
So, each X server started should now have it's own "xmailleds" process. Each
"X" mailleds should probably be started from .xinitrc or similar, using
something like: "xmailleds -l s".
You can also do "xmailleds -l s -d <display name>" from anywhere, outside or
inside of X.
*********************************
|BUGS BUGS BUGS BUGS BUGS (BUGS)|
*********************************
If you have 2 mailleds processes, one a "mailleds -t" that flashes all your
logged in terminals, and one a "xmailleds" that flashes your current X
display, _and_ you start your X session from a terminal using "startx" (or
similar), mailleds will not function properly. (Read that last sentence
again, despite my awful sentence structure. It's important.) The keyboard
lights will do funky crap, as both the terminal that's controlling the X
server and the X server's leds will be flashing. Unpredictable crap. Argh.
Well, I'm working on it. The only fix I know is either a) don't run the
"mailleds -t", or b) don't start X from the command line =).
mailleds, any version at all, might be unstable with development
kernels (1.3.x), since it relies on ioctl syscalls, the most undocumented
and unstable of all kernel calls. I've heard of some problems, but all
kernels I've tried work fine. If you want, try setleds(1). If running
setleds does *not* cause the same problems as mailleds, write me about it.
Otherwise, I don't want to hear about it.
Other bugs? You know the shpiel. mtr@ratbert.bagel.org.
1. Overview
Mailleds is a tiny daemon that monitors a mailbox, and when the mailbox
contains new mail, blinks some LEDs. These LEDs can be found two places --
on one's keyboard, or hooked up to a parallel port (a la portato). I find
that it's a nice way to tell you have mail -- it doesn't interrupt
whatever you're doing by posting an on-screen message. Another benefit of
LED mail notification is that the monitor need not be on. I can leave my
monitor off all day, and either turn it on or not depending on whether or
not I have mail. But then again, I'm the author; I have an inherent,
ego-driven need to find this program useful...=) So go ahead, check it out.
On my 386-40 (quite a development platform, I know) with 8 megs of ram,
mailleds takes somewhere between .1% and .5% of my CPU time, and 4.6% of my
memory. This is when mailleds is invoked as
mailleds -aq -t /dev/tty[1-6] and there are two mail messages in my inbox.
Other options will vary CPU time, of course.
2. General stuff
As of now, mailleds has two basic modes: "answering machine" mode, and
"normal" mode. Answering machine mode (I didn't know what else to call it,
even though I've never seen an answering machine blink out the number of
messages it has. Usually it has a nifty LCD display or something.
Anyways.) will blink out the number of emails you have received, pause, and
repeat. The other mode, is...basic. It just blinks whenever you have mail.
I don't even *consider* using basic mode anymore.
In -a (answering machine) mode, the timings are mildly important in order to
appease the eye. Check out the variables in config.h for stuff on this.
(should I make this a run-time option?)
I have other modes planned, based on works like "portato", etc. Just
imagine -- a 7-led display (one of the ones that forms numbers) plus an
extra led to tell you the 10s column. One could also use the lcd circuit
built in "lcd-clock" or some such package (it's on sunsite). I'd build one
of these and add support, if I cared (I don't).
3. Some finer notes on doing the parallel port led thing
To do the parallel lights thing, check out led-stat.txt in the mailleds
source directory to wire it right and invoke mailleds like:
mailleds -aq -l p5
For parallel lights to work mailleds must be suid root.
NOTE:
When blinking just keyboard LEDs, mailleds will terminate when the
user it's blinking for has logged out of all the ttys specified on the
command line. When doing parallel LEDs, mailleds will not terminate untill
it recieves a signal.
Port leds will not disable screen blanking as keyboard leds did. For those
concerned with monitor burn in, this is a good thing. As for me, I find it
kind of irritating. I *liked* being able to tell whether I had mail by
glancing at my monitor after blanking time had expired. :)
The plain vanilla parallel cable I bought was wired like this. I assume no
responsibility for any damage this info may cause.
pin 2 - red
pin 3 - orange
pin 4 - yellow
pin 5 - dark green
pin 6 - dark blue
pin 7 - purple
pin 8 - gray
pin 9 - white
pin 25 (ground) - Black w/ white stripe
If you want to run mailleds in conjunction with a portato that is <= 1.2,
please apply portato.c.diff by doing:
cd /usr/src/portato
patch < portato.c.diff
This makes portato play nicely with mailleds and any other led controlling
program. This patch is included in > 1.2 versions of portato.
4. Some of the Nastier Stuff
Mailleds should run suid root, due to a limitation in the ioctl()
system call which refuses to change another terminal's LEDs -- even if
that terminal and the current tty are owned by the same user.
Mailleds will run fine without the suid bit, but only the controlling
terminal's (/dev/tty) LEDs will be able to blink. If you specify
other tty's while running non-suid-root, mailleds will terminate with an
error message.
Mailleds, as stated in the man page, will interfere will linux screen
blanking (when run with keyboard leds). This is because data is being sent
to and received from the keyboard. There's a comment in the kernel code
about this, but I'm no kernel hacker.
5. Thanks to:
Erik Hetzner, inventor of this craziness
Joseph W. Vigneau and his roommate damian@wpi.edu for their nifty
parallel port concept and programs.
The author of setleds (who is it?)
Tom Waits, They Might Be Giants, Bill Evans and Leonard Cohen.
Linus, of course.
This is my first (and most likely not last) contribution to the Linux
project, so forgive any newbie coding mistakes I have made in the
process. It started as a shell script, and has made its way through a
perl script up to C, finally. Having said this, Bug reports,
comments, patches are welcome to:
mtr@ratbert.bagel.org (Benjamin Osheroff)